home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / AIFF.h < prev    next >
Text File  |  1991-04-17  |  3KB  |  192 lines

  1. /*
  2.     File:        AIFF.h
  3.  
  4.     Contains:    Definition of AIFF file format componentes
  5.  
  6.     Copyright © Apple Computer, Inc. 1989-1991 
  7.     All rights reserved
  8.  
  9. */
  10.  
  11. #ifndef __AIFF__
  12. #define __AIFF__
  13.  
  14. #ifndef __TYPES__
  15. #include <Types.h>
  16. #endif
  17.  
  18. #define AIFFID                        'AIFF'
  19. #define    AIFCID                        'AIFC'
  20. #define FormatVersionID                'FVER'
  21. #define CommonID                    'COMM'
  22. #define FORMID                        'FORM'
  23. #define SoundDataID                    'SSND'
  24. #define MarkerID                    'MARK'
  25. #define InstrumentID                'INST'
  26. #define MIDIDataID                    'MIDI'
  27. #define AudioRecordingID            'AESD'
  28. #define ApplicationSpecificID        'APPL'
  29. #define CommentID                    'COMT'
  30. #define NameID                        'NAME'
  31. #define AuthorID                    'AUTH'
  32. #define CopyrightID                    '(c) '
  33. #define AnnotationID                'ANNO'
  34. #define NoLooping                    0
  35. #define ForwardLooping                1
  36. #define ForwardBackwardLooping        2
  37.  
  38. /* AIFF-C Versions */
  39. #define AIFCVersion1                0xA2805140
  40.  
  41. /* Compression Types */
  42. #define    NoneName                    "\pnot compressed"
  43. #define    ACE2to1Name                    "\pACE 2-to-1"
  44. #define    ACE8to3Name                    "\pACE 8-to-3"
  45. #define    MACE3to1Name                "\pMACE 3-to-1"
  46. #define    MACE6to1Name                "\pMACE 6-to-1"
  47.  
  48. /* Compression Names */
  49. #define    NoneType                    'NONE'
  50. #define    ACE2Type                    'ACE2'
  51. #define    ACE8Type                    'ACE8'
  52. #define    MACE3Type                    'MAC3'
  53. #define    MACE6Type                    'MAC6'
  54.  
  55. typedef  unsigned long                ID;      
  56. typedef     short                        MarkerIdType;
  57.  
  58. typedef struct
  59. {
  60. ID                    ckID;
  61. long                ckSize;
  62. } ChunkHeader;
  63.  
  64. typedef struct
  65. {
  66. ID                    ckID;
  67. long                ckSize;
  68. ID                    formType;
  69. } ContainerChunk;
  70.  
  71. typedef struct
  72. {
  73. ID                    ckID;
  74. long                ckSize;
  75. unsigned long        timestamp;
  76. } FormatVersionChunk,*FormatVersionChunkPtr;
  77.  
  78. typedef struct
  79. {
  80. ID                    ckID;
  81. long                ckSize;
  82. short                numChannels;
  83. unsigned long        numSampleFrames;
  84. short                sampleSize;
  85. extended            sampleRate;
  86. } CommonChunk,*CommonChunkPtr;
  87.  
  88. typedef struct
  89. {
  90. ID                    ckID;
  91. long                ckSize;
  92. short                numChannels;
  93. unsigned long        numSampleFrames;
  94. short                sampleSize;
  95. extended            sampleRate;
  96. ID                    compressionType;
  97. char                compressionName[1];
  98. } ExtCommonChunk,*ExtCommonChunkPtr;
  99.  
  100. typedef struct
  101. {
  102. ID                    ckID;
  103. long                ckSize;
  104. unsigned long        offset;
  105. unsigned long        blockSize;
  106. } SoundDataChunk, *SoundDataChunkPtr;
  107.  
  108. typedef struct
  109. {
  110. MarkerIdType            id;
  111. unsigned long        position;
  112. Str255                markerName;
  113. } Marker;
  114.  
  115. typedef struct
  116. {
  117. ID                    ckID;
  118. long                ckSize;
  119. unsigned short        numMarkers;
  120. Marker                Markers[1];
  121. } MarkerChunk, *MarkerChunkPtr;
  122.  
  123. typedef struct
  124. {
  125. short                playMode;
  126. MarkerIdType        beginLoop;
  127. MarkerIdType        endLoop;
  128. } AIFFLoop;
  129.  
  130. typedef struct
  131. {
  132. ID                    ckID;
  133. long                ckSize;
  134. char                baseFrequency;
  135. char                detune;
  136. char                lowFrequency;
  137. char                highFrequency;
  138. char                lowVelocity;
  139. char                highVelocity;
  140. short                gain;
  141. AIFFLoop            sustainLoop;
  142. AIFFLoop            releaseLoop;
  143. } InstrumentChunk, *InstrumentChunkPtr;
  144.  
  145. typedef struct
  146. {
  147. ID                    ckID;
  148. long                ckSize;
  149. unsigned char        MIDIdata[1];
  150. } MIDIDataChunk, *MIDIDataChunkPtr;
  151.  
  152. typedef struct
  153. {
  154. ID                    ckID;
  155. long                ckSize;
  156. unsigned char        AESChannelStatus[24];
  157. } AudioRecordingChunk, *AudioRecordingChunkPtr;
  158.  
  159. typedef struct
  160. {
  161. ID                    ckID;
  162. long                ckSize;
  163. OSType                applicationSignature;
  164. char                data[1];
  165. } ApplicationSpecificChunk, *ApplicationSpecificChunkPtr;
  166.  
  167. typedef struct
  168. {
  169. unsigned long        timeStamp;
  170. MarkerIdType        marker;
  171. unsigned short        count;
  172. char                text[1];
  173. } Comment;
  174.  
  175. typedef struct
  176. {
  177. ID                    ckID;
  178. long                ckSize;
  179. unsigned short        numComments;
  180. Comment                comments[1];
  181. } CommentsChunk, *CommentsChunkPtr;
  182.  
  183. typedef struct
  184. {
  185. ID                    ckID;
  186. long                ckSize;
  187. char                text[1];
  188. } TextChunk, *TextChunkPtr;
  189.  
  190.  
  191. #endif
  192.